package com.youlai.boot.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.youlai.boot.system.mapper.ConsolidationMapper;
import com.youlai.boot.system.mapper.CultivationMapper;
import com.youlai.boot.system.model.QB.Cultivation;
import com.youlai.boot.system.service.CultivationService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;
@Service
public class CultivationServiceImpl extends ServiceImpl<CultivationMapper,Cultivation> implements CultivationService {
    private static final Logger logger = LoggerFactory.getLogger(DeviceServiceImpl.class);
    @Autowired
    private CultivationMapper cultivationMapper;
    @Override
    public boolean saveCultivation(Cultivation cultivation) {

        cultivation.setAddtime(LocalDateTime.now());
        return save(cultivation);
    }

    @Override
    public List<Cultivation> getAllCultivation() {
        return cultivationMapper.selectList(null);
    }

    @Override
    public boolean deleteCultivationById(Integer id) {
        return cultivationMapper.deleteById(id)>0;
    }
}
